package com.tianyi.sfzy1.controller;

import com.tianyi.sfzy1.service.ConsultationreviewService;
import com.tianyi.sfzy1.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: RenJianWoDi
 * @Date: 2025/1/11 16:48
 * @Description:
 */
@RestController
@RequestMapping("/consultreview")
public class ConsultationreviewController {

    @Autowired
    private ConsultationreviewService consultationreviewService;
    /**
     * 通过成员id和咨询id以及星级内容增加评价
     */
    @PostMapping
    public R insert(int memberId,int appointmentId,int stars,String content){
        int i=consultationreviewService.insert(memberId,appointmentId,stars,content);
        if (i>0){
            return R.ok(null);
        }else {
            return R.fail("添加失败");
        }
    }
}
